package cn.mw.cmdb.param;

/**
 * 资产监控概览类型枚举
 */
public enum OverViewEnum {
    mwDefault("0" ,"通用" )
    ,mwNetWork("1" ,"网络设备" )
    ,mwServer("2" ,"服务器" )
    ,mwStorage("3","存储设备" );
    private String code;
    private String name;

    OverViewEnum(String code , String name ){
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static OverViewEnum getTypeOf(String name){
        for(OverViewEnum checkModelEnum : OverViewEnum.values()){
            if(name.equals(checkModelEnum.getName())){
                return checkModelEnum;
            }
        }
        return null;
    }
    public static String getOverViewCode(String name){
        for(OverViewEnum checkModelEnum : OverViewEnum.values()){
            if(name.equals(checkModelEnum.getName())){
                return checkModelEnum.getCode();
            }
        }
        return OverViewEnum.mwDefault.getCode();
    }

    public static String getOverViewType(String code){
        for(OverViewEnum checkModelEnum : OverViewEnum.values()){
            if(checkModelEnum.getCode().equals(code)){
                return checkModelEnum.getName();
            }
        }
        return null;
    }
}
